<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
		       /* for (let i = 0; i < 10; i++) {
		            for (let j = 1;j <= i; j++){
		                console.log(i +"*"+ j +"=" + i*j)
		            }
		        }*/
				//179000541陈建璋
							/*for (var i = 1; i <= 5; i++) {
								for (var j = 0; j < (5 - i); j++) {
									document.write("&nbsp;&nbsp;");
								}
								document.write("*");
								for (var j = 1; j < i; j++) {
									document.write("&nbsp;&nbsp;&nbsp;*");
								}
								document.write("<br>");
							}
				
							for (var i = 1; i <= 5; i++) {
								for (var j = 0; j < (5 - i); j++) {
									document.write("&nbsp;&nbsp;");
								}
								document.write("*");
								for (var j = 1; j < 5; j++) {
									document.write("&nbsp;&nbsp;&nbsp;*");
								}
								document.write("<br>");
							}*/
/*console.log(add(2,3));
var add = function(num1,num2){
	return num1 + num2;
}*/
//179000541 陈建璋
 /* var obj1 ={
	  name:"刘备",
	  sex:"男",
	  run: function(){A
		  console.log("跑");
	  }
  }
  //object方式创建
  var obj2= new Object();
  obj2.name ="刘备";
  obj2.sex ="男";
  obj2.run =function(){
	  console.log("跑");
  }	  
  //工厂模式
  function createPerson(p_name, p_sex, p_run){
	  var tempPerson =new Object();
	  tempPerson.name =p_name;
	  tempPerson.sex =p_sex;
	  tempPerson.run =p_run;
	  return tempPerson;
		}
		var obj3= createPerson("刘备","男",new Function("console.log('跑')"));
		var obj4= createPerson("张飞","男",new Function("console.log('飞跑')"));
		//体验构造函数创建对象
		function Student(name,sex){
			this.name=name;
			this.sex=sex;
			this.run=function(){
				console.log(this.name + "跑");
			}
		}
		var obj5 =new Student("刘备","男");
		//体验原型模式创建
		function Person(){}
		Person.prototype.name="刘备";
		Person.prototype.sex="男";
		Person.prototype.run=function(){
			console.log(this.name + "跑");
		};
		var obj6 =new Person();
		console.log(obj6);
		obj6.run();
		
		function Person(name){
			this.name =name;
		}
		var obj =new Person("刘备");
		console.log(Object.getOwnPropertyDescriptor(obj,"name"));
		
		
		function fun(){
			console.log(this);
		}
		fun();*/
		
					//179000541 陈建璋
					/*let arr1 = [1, 2, 3];
					let arr2 = arr1;
					console.log(arr1 == arr2); 
		
					let arr3 = [...arr1];
					console.log(arr1 == arr3); 
					//...arr1:这个扩展运算符把数组里面的元素展开
					//console.log(...arr); 打印结果 1 2 3;等价于console.log(1,2,3);所以它与arr1不等;
		
					let arr4 = [1, 2, 3];
					arr4.forEach(function(v, k) {
						console.log(k); 
					})
					//箭头函数
					arr4.forEach((v, k) => console.log(k)); 
		
					Array.of(1, 2, 3).filter(i => i > 1).forEach(i => console.log(i));
					let fib = n => n > 1 ? fib(n - 1) + fib(n - 2) : n;
		
					class Animal1 {
						constructor(name) { //constructor构造函数
							this.name = name;
						}
						shount() { 
							console.log('Hello, ' + this.name + '!');
						}
					}
					var hashiqi = new Animal1('大黄');
					hashiqi.name; 
					hashiqi.shount(); 
					// 用extends继承扩展 
					class Dog extends Animal1 {
						constructor(name,age) { 
							super(name);
							this.age = age;
						}
						eat() {
							console.log(this.name + " " +'年龄：' + this.age +" " + "正在吃东西");
						}
					}
					var liyi = new Dog('旺财', '5',);
					liyi.eat(); */
					let arr=[1,2,3,4,5,6,7,8,9];
					for(let num>arr){
						if(num%2==0){
							console.log(num);
						} else{
							console.log(num-1);
						}
					}
					
				</script>
				
			</body>
		<ml>

	  </script>

	</body>
</html>
